package view.configuration;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;


public class IndividualsPanel extends JPanel {
	
	
	private JButton agregar;
	private JButton eliminar;
	private JButton consultar;
	private JButton modificar;
	private JButton eliminarTodo;
	private NoEditTable tabla;
	private JScrollPane scroll;
	private JPanel south;
	
	public IndividualsPanel() {
		
		initComponents();
		addcomponents();
	}
	
	public void initComponents() {
		
		setLayout(new BorderLayout());
		agregar = new JButton("Agregar");
		eliminar = new JButton("Eliminar");
		consultar = new JButton("Consultar");
		modificar = new JButton("Modificar");
		eliminarTodo = new JButton("Eliminar todo");
		south = new JPanel();
		south.setLayout(new GridLayout(1,5));
		DefaultTableModel modelo = new DefaultTableModel();
		tabla = new NoEditTable(modelo);
		tabla.enableInputMethods(false);
		tabla.setDragEnabled(false);
		scroll = new JScrollPane(tabla);
	}

	public void addcomponents() {
		
		//south.add(new JPanel());
		south.add(agregar);
		south.add(consultar);
		south.add(modificar);
		south.add(eliminar);
		south.add(eliminarTodo);
		//south.add(new JPanel());
		add(BorderLayout.CENTER,scroll);
		add(BorderLayout.SOUTH,south);
	}

	public JButton getAgregar() {
		return agregar;
	}

	public void setAgregar(JButton agregar) {
		this.agregar = agregar;
	}

	public JButton getEliminar() {
		return eliminar;
	}

	public void setEliminar(JButton eliminar) {
		this.eliminar = eliminar;
	}

	public JButton getConsultar() {
		return consultar;
	}

	public void setConsultar(JButton consultar) {
		this.consultar = consultar;
	}

	public JButton getModificar() {
		return modificar;
	}

	public void setModificar(JButton modificar) {
		this.modificar = modificar;
	}

	public JButton getEliminarTodo() {
		return eliminarTodo;
	}

	public void setEliminarTodo(JButton eliminarTodo) {
		this.eliminarTodo = eliminarTodo;
	}

	public NoEditTable getTabla() {
		return tabla;
	}

	public void setTabla(NoEditTable tabla) {
		this.tabla = tabla;
	}

	public JScrollPane getScroll() {
		return scroll;
	}

	public void setScroll(JScrollPane scroll) {
		this.scroll = scroll;
	}
}
